<template>
  <div class="box">
    <div class="box1">
      <div class="word">修改密码</div>
      <v-form
        ref="form"
        lazy-validation
        style="
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          align-item: center;
          height: 50vh;
          width: 20vw;
        "
      >
        <v-text-field
          v-model="loginForm.username"
          :rules="[(v) => !!v || 'ID is required']"
          label="StudentID"
          required
        ></v-text-field>

        <v-text-field
          v-model="loginForm.password"
          :type="'password'"
          :rules="[(v) => !!v || 'Password is required']"
          label="New Password"
          required
        ></v-text-field>

        <v-text-field
          v-model="loginForm.password2"
          :type="'password'"
          :rules="[
            (v) => v == loginForm.password || 'Password is not identical',
          ]"
          label="Reenter New password"
          required
        ></v-text-field>

        <v-row class="row">
          <v-text-field
            v-model="loginForm.telephone"
            :rules="[
              (v) => v.length == 11 || 'Please enter the correct phone number',
            ]"
            label="Phone number"
            required
            class="tel"
          ></v-text-field>
          <v-btn color="info" class="codeButtom"> 获取验证码</v-btn>
        </v-row>

        <v-text-field
          v-model="loginForm.code"
          label="Verification Code"
          required
        ></v-text-field>

        <v-btn style="height: 6vh; margin: 1vh auto; width: 20vw" color="info" @click="toLogin">
          确认
        </v-btn>
      </v-form>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      loginForm: {
        username: "",
        password: "",
        password2: "",
        telephone: "",
        code: "",
      },
    };
  },
  methods:{
    toLogin(){
       this.$router.push('/login')
    }
  }
};
</script>
<style scoped>
.box {
  display: flex;
  width: 100%;
  height: 100vh;
  background: url("../../assets/login_bg.png") top left no-repeat;
  background-size: 100vw 100vh;
  justify-content: center;
  align-items: center;
}
.box1 {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex-direction: column;
  width: 26vw;
  height: 70vh;
  margin: 0 auto;
  background: #fff;
  padding: 20px 40px;
  border-radius: 10px;
  box-shadow: 0px 0px 30px 5px #eeeeee;
}
.word {
  margin: 1vh auto;
  width: 100%;
  height: 3vh;
  text-align: center;
  line-height: 0vh;
  font-size: 26px;
  color: #0076f6;
  letter-spacing: 6px;
}
.codeButtom {
  margin-top: 1.5vh;
  width: 6vw;
}
.row {
  margin: 0;
  width: 100%;
}
</style>